package com.ormbench.base.dao;

import java.io.Serializable;
import java.util.List;

/**
 * Implements the generic CRUD data access operations.
 * <p>
 * To write a DAO, subclass and parameterize this class with your persistent class.
 * Of course, assuming that you have a traditional 1:1 appraoch for Entity:DAO design.
 * <p>
 */
public interface BaseDAO<T, ID extends Serializable> {
	public Class<T> getPersistentClass();
	public T create(T entity);
	public int createAll(List<T> entities);
	public T read(ID id);
	public T update(T entity);
	public int updateAll(List<T> entities);
	public void delete(T entity);
    public void deleteById(ID id);
    public void deleteByIds(List<ID> ids);
	public void deleteAll();
	public List<T> findByExample(T example);
	public List<T> findAll();
}

